

#ifndef BOX_H
#define BOX_H

#include"object.h"
#include"ray.h"

class Box: public Object
{
  protected:
  float min[3];
  float max[3];
  float* image;
  int w_image;
  int h_image;
  public:
  Box (float xmin,float xmax,float ymin,float ymax,float zmin,float zmax):
    image(NULL)
  {
    min[0] = xmin;  min[1] = ymin;  min[2] = zmin; 
    max[0] = xmax;  max[1] = ymax;  max[2] = zmax; 
  };
  void SetImage (float * img, int w, int h)
  {
    image = img; w_image = w; h_image = h;
  };
  bool Hit_aux (Ray * ray, float* p, float* d);
  bool Hit (Ray * ray);
};

#endif
